﻿CREATE TABLE [dbo].[arhJurnaleSolduriInitiale] (
    [IDJurnal]        INT             NOT NULL,
    [Cont]            [dbo].[TipCont] NOT NULL,
    [CodUnitate]      SMALLINT        DEFAULT ((0)) NOT NULL,
    [DebitInitial]    DECIMAL (18, 2) DEFAULT ((0)) NOT NULL,
    [CreditInital]    DECIMAL (18, 2) DEFAULT ((0)) NOT NULL,
    [DebitPrecedent]  DECIMAL (20, 2) DEFAULT ((0)) NOT NULL,
    [CreditPrecedent] DECIMAL (20, 2) DEFAULT ((0)) NOT NULL,
    [An]              SMALLINT        DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_arhJurnaleSolduriInitiale] PRIMARY KEY CLUSTERED ([IDJurnal] ASC, [Cont] ASC, [CodUnitate] ASC, [An] ASC),
    CONSTRAINT [FK_arhJurnaleSolduriInitiale_arhConturi] FOREIGN KEY ([Cont], [CodUnitate], [An]) REFERENCES [dbo].[arhConturi] ([Cont], [CodUnitate], [An]),
    CONSTRAINT [FK_arhJurnaleSolduriInitiale_Jurnale] FOREIGN KEY ([IDJurnal]) REFERENCES [dbo].[Jurnale] ([IDJurnal]),
    CONSTRAINT [FK_arhJurnaleSolduriInitiale_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

